%matplotlib inline
import glob
import matplotlib
from matplotlib import pyplot
import numpy
import os
import pandas
import seaborn
import sys
pandas.options.display.max_columns = None
pandas.options.display.max_rows = None
matplotlib.rcParams['figure.dpi'] = 200
matplotlib.rcParams['agg.path.chunksize'] = 10000
print(f'Package versions:\nPython {sys.version}, matplotlib {matplotlib.__version__}, '
f'numpy {numpy.__version__}, pandas {pandas.__version__}, '
f'seaborn {seaborn.__version__}')
Package versions: Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:53) [GCC 9.4.0], matplotlib 3.4.2, numpy 1.21.0, pandas 1.1.5, seaborn 0.11.1
drop_dups = pandas.read_csv('./read_dataframe.csv')
print(drop_dups.shape)
drop_dups.head()
(11774142, 12)
| well_id | r1 | r2 | seq_corr | edit_type | umi | bc_tracer | het_spacer_offset | bc1_corr | bc2_corr | condition | read_count | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | A1 | NCCATTCTCATCTAAACCCCCTGAAGCTTCACCAGCGCAATTATTC... | NAGACGTGTGCTCTTCCGACGTCTACACTCGNNNNNNNCCACCGTN... | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | 1 |
| 1 | A1 | GCCATTCTCATCCAAACCCCCTGAAGCTTCACCGGCGCAGTCATTC... | NAGACGTGTGCTCTTCCGAGTGCGTGAAATACCGTCAACACACGTG... | GCCATTCTCATCCAAACCCCCTGAAGCTTCACCGGCGCAGTCATTC... | WT | GTGCGTGAAA | UNKNOWN | 0 | CTCAATGA | TACCGTCA | d5_low_silent_r1 | 1 |
| 2 | A1 | GCCATTCTCATCCAAACCCCCTGAAGCTTCACCGGCGCAGTCATTC... | NAGACGTGTGCTCTTCCATTATGCGGGTCCGTCGCGATCCACGTGC... | GCCATTCTCATCCAAACCCCCTGAAGCTTCACCGGCGCAGTCATTC... | WT | TATGCGGGTC | UNKNOWN | 0 | UNKNOWN | UNKNOWN | UNKNOWN | 1 |
| 3 | A1 | GCCATTCTCATCCAAACCCCCTGAAGCTTCACCGGCGCAGTCATTC... | NAGACGTGTGCTCTTCCGATATGTGCGCTTAAGGTAAATCCACTTG... | GCCATTCTCATCCAAACCCCCTGAAGCTTCACCGGCGCAGTCATTC... | WT | TATGTGCGCT | UNKNOWN | 0 | CTCAATGA | TAAGGTAA | d5_low_silent_r1 | 1 |
| 4 | A1 | GCCATTCTCATCCAAACCCCCTGAAGCTTCACCGGCGCAGTCATTC... | CAGACGTGTGCCCTTTCGATTGACTGGTATACGGTCAAACAACGTG... | GCCATTCTCATCCAAACCCCCTGAAGCTTCACCGGCGCAGTCATTC... | WT | TTGACTGGTA | UNKNOWN | 0 | UNKNOWN | TACCGTCA | UNKNOWN | 1 |
all_stats = drop_dups.groupby('edit_type')['read_count'].sum()
all_stats['TOTAL'] = all_stats.sum()
all_stats = all_stats.reset_index().sort_values(by='read_count', ascending=False)
all_stats
| edit_type | read_count | |
|---|---|---|
| 10 | TOTAL | 11883915 |
| 9 | WT | 6889727 |
| 5 | SILENT | 2473967 |
| 1 | LHON_BY1 | 1279990 |
| 8 | UNKNOWN | 759119 |
| 0 | LHON | 127794 |
| 3 | LHON_BY3 | 100533 |
| 2 | LHON_BY2 | 78902 |
| 6 | SILENT_BY1 | 78739 |
| 4 | LHON_BY4 | 67603 |
| 7 | SILENT_BY2 | 27541 |
#plot read 1 matches
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(6,4))
seaborn.barplot(data=all_stats, x='edit_type', y='read_count', ax=axes)
axes.set_xticklabels(axes.get_xticklabels(), rotation=45, ha='right', fontsize=10)
axes.set_xlabel('')
axes.set_ylabel('Read count')
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(4,4))
axes.bar(x=0, height=all_stats.loc[all_stats['edit_type'] == 'TOTAL', 'read_count'], color='C0')
stacked_indices = ~all_stats['edit_type'].isin(['UNKNOWN', 'TOTAL'])
bottom=0
for r1_name, val in all_stats.loc[stacked_indices].to_numpy():
axes.bar(x=1, height=val, bottom=bottom, label=r1_name)
bottom += val
axes.bar(x=2, height=all_stats.loc[all_stats['edit_type'] == 'UNKNOWN', 'read_count'], color='C0')
axes.set_xticks(numpy.arange(3))
axes.set_xticklabels(['Total reads', 'Expected matches', 'Unmatched'], ha='right', rotation=35)
axes.set_ylabel('Read count')
axes.legend(bbox_to_anchor=[1,1])
fig.tight_layout()
all_stats = drop_dups.groupby('condition')['read_count'].sum()
all_stats['TOTAL'] = all_stats.sum()
order = ['TOTAL', 'UNKNOWN'] + sorted(all_stats.loc[~all_stats.index.isin(['TOTAL', 'UNKNOWN'])].index.values)
all_stats = all_stats.loc[order].rename('read_count').reset_index()
all_stats
| condition | read_count | |
|---|---|---|
| 0 | TOTAL | 11883915 |
| 1 | UNKNOWN | 4999055 |
| 2 | d0_lhon_r1 | 143634 |
| 3 | d0_lhon_r2 | 146308 |
| 4 | d0_lhon_r3 | 196591 |
| 5 | d0_silent_r1 | 260238 |
| 6 | d0_silent_r2 | 220869 |
| 7 | d0_silent_r3 | 126572 |
| 8 | d5_high_lhon_r1 | 159514 |
| 9 | d5_high_lhon_r2 | 191347 |
| 10 | d5_high_lhon_r3 | 176685 |
| 11 | d5_high_silent_r1 | 256625 |
| 12 | d5_high_silent_r2 | 320269 |
| 13 | d5_high_silent_r3 | 305760 |
| 14 | d5_low_lhon_r1 | 216357 |
| 15 | d5_low_lhon_r3 | 147897 |
| 16 | d5_low_silent_r1 | 306902 |
| 17 | d5_low_silent_r2 | 205732 |
| 18 | d5_low_silent_r3 | 219215 |
| 19 | d5_med_lhon_r1 | 478868 |
| 20 | d5_med_lhon_r2 | 506895 |
| 21 | d5_med_lhon_r3 | 482356 |
| 22 | d5_unsort_lhon_r1 | 258787 |
| 23 | d5_unsort_lhon_r2 | 360709 |
| 24 | d5_unsort_lhon_r3 | 291066 |
| 25 | d5_unsort_silent_r1 | 275515 |
| 26 | d5_unsort_silent_r2 | 358604 |
| 27 | d5_unsort_silent_r3 | 271545 |
#plot read 2 matches
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(8,3))
seaborn.barplot(data=all_stats, x='condition', y='read_count', ax=axes)
axes.set_xticklabels(axes.get_xticklabels(), rotation=45, ha='right', fontsize=10)
axes.set_xlabel('')
axes.set_ylabel('Read count')
fig.tight_layout()
#plot read 2 matches
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(8,3))
seaborn.barplot(data=all_stats, x='condition', y='read_count', ax=axes)
axes.set_yscale('log')
axes.set_xticklabels(axes.get_xticklabels(), rotation=45, ha='right', fontsize=10)
axes.set_xlabel('')
axes.set_ylabel('Read count')
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(8,4))
axes.bar(x=0, height=all_stats.loc[all_stats['condition'] == 'TOTAL', 'read_count'], color='C0')
stacked_indices = ~all_stats['condition'].isin(['UNKNOWN', 'TOTAL'])
bottom=0
for r1_name, val in all_stats.loc[stacked_indices].to_numpy():
axes.bar(x=1, height=val, bottom=bottom, label=r1_name)
bottom += val
axes.bar(x=2, height=all_stats.loc[all_stats['condition'] == 'UNKNOWN', 'read_count'], color='C0')
axes.bar(x=3, height=numpy.sum(drop_dups['bc2_corr'] != 'UNKNOWN'), color='C0')
axes.bar(x=4, height=numpy.sum(drop_dups['bc2_corr'] == 'UNKNOWN'), color='C0')
axes.set_xticks(numpy.arange(5))
axes.set_xticklabels(['Total reads', 'Matched bc1', 'Unmatched bc1',
'Matched bc2', 'Unmatched bc2'], ha='right', rotation=35)
axes.set_ylabel('Read count')
axes.legend(bbox_to_anchor=[1,1], fontsize=6)
fig.tight_layout()
valid_cells = pandas.read_csv('./heteroplasmy_dataframe.csv')
print(valid_cells.shape)
valid_cells.head()
(9978, 13)
| cell_id | condition | umi_count | LHON | LHON/SILENT | SILENT | WT | umi_count_for_filtering | umi_count_rank | LHON_het | SILENT_het | SILENT_ONLY_het | total_het | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | A1-CTCAATGA-TAAGGTAA | d5_low_silent_r1 | 34 | 0 | 1 | 2 | 31 | 34 | 4902 | 0.029412 | 0.088235 | 0.058824 | 0.088235 |
| 1 | A1-ACACAGAA-GATACGCA | d5_unsort_lhon_r3 | 37 | 0 | 3 | 1 | 33 | 37 | 4429 | 0.081081 | 0.108108 | 0.027027 | 0.108108 |
| 2 | A1-AACAACCA-CGTTAGAT | d5_unsort_lhon_r1 | 30 | 0 | 4 | 8 | 18 | 30 | 6043 | 0.133333 | 0.400000 | 0.266667 | 0.400000 |
| 3 | A1-ACGTATCA-GCATGCCG | d5_unsort_silent_r2 | 25 | 0 | 3 | 7 | 15 | 25 | 8087 | 0.120000 | 0.400000 | 0.280000 | 0.400000 |
| 4 | A1-CCGTGAGA-CCAGGCTT | d5_low_lhon_r1 | 24 | 0 | 2 | 1 | 21 | 24 | 8095 | 0.083333 | 0.125000 | 0.041667 | 0.125000 |
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(7,4))
xorder = sorted(valid_cells['condition'].unique())
seaborn.countplot(data=valid_cells, x='condition', order=xorder, ax=axes)
axes.set_xticklabels(axes.get_xticklabels(), ha='right', rotation=45)
fig.tight_layout()
bulk_estimates = pandas.read_csv('../Bulk_LHON_timeseries/mut_counts.csv')
bulk_estimates['TOTAL_het'] = bulk_estimates[['LHON', 'LHON_BY1', 'LHON_BY2', 'LHON_BY3', 'LHON_BY4',
'SILENT', 'SILENT_BY1', 'SILENT_BY2']].sum(axis=1)/bulk_estimates['TOTAL']
print(bulk_estimates.shape)
bulk_estimates
(72, 19)
| sample_id | LHON | LHON_BY1 | LHON_BY2 | LHON_BY3 | LHON_BY4 | MUT | SILENT | SILENT_BY1 | SILENT_BY2 | UNKNOWN | WT | TOTAL | LHON_het | SILENT_het | MUT_het | sample_id.1 | sci-lite_sample | TOTAL_het | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | A1 | 111 | 190 | 11 | 12 | 8 | 0 | 534 | 10 | 6 | 271 | 24419 | 25301 | 0.013122 | 0.021738 | 0.000000 | 1NT-unsorted_d0-0_d0 | none | 0.034860 |
| 1 | A10 | 6390 | 101575 | 4285 | 4758 | 4678 | 0 | 101644 | 3572 | 2396 | 11507 | 514283 | 743581 | 0.163649 | 0.144721 | 0.000000 | 1LHON-unsorted_d5-0_d0 | d5_unsort_lhon_r1 | 0.308370 |
| 2 | A11 | 1888 | 19880 | 4817 | 1039 | 1054 | 0 | 43569 | 679 | 695 | 11625 | 201180 | 274801 | 0.104359 | 0.163547 | 0.000000 | 2LHON-unsorted_d5-0_d0 | d5_unsort_lhon_r2 | 0.267907 |
| 3 | A12 | 80 | 947 | 41 | 40 | 41 | 0 | 1142 | 26 | 28 | 206 | 5101 | 7446 | 0.154311 | 0.160623 | 0.000000 | 3LHON-unsorted_d5-0_d0 | d5_unsort_lhon_r3 | 0.314934 |
| 4 | A2 | 11 | 38 | 3 | 3 | 4 | 0 | 153 | 5 | 2 | 39 | 1158 | 1377 | 0.042847 | 0.116195 | 0.000000 | 2NT-unsorted_d0-0_d0 | none | 0.159041 |
| 5 | A3 | 57 | 82 | 3 | 2 | 6 | 0 | 310 | 5 | 2 | 272 | 24377 | 24844 | 0.006038 | 0.012760 | 0.000000 | 3NT-unsorted_d0-0_d0 | none | 0.018797 |
| 6 | A4 | 67 | 154 | 7 | 12 | 10 | 0 | 520 | 16 | 4 | 121 | 6995 | 7785 | 0.032113 | 0.069364 | 0.000000 | 1LHON-unsorted_d0-0_d0 | d0_lhon_r1 | 0.101477 |
| 7 | A5 | 131 | 216 | 9 | 16 | 5 | 0 | 1481 | 19 | 6 | 263 | 22861 | 24744 | 0.015236 | 0.060863 | 0.000000 | 2LHON-unsorted_d0-0_d0 | d0_lhon_r2 | 0.076099 |
| 8 | A6 | 157 | 281 | 1 | 19 | 10 | 0 | 3371 | 32 | 8 | 525 | 43184 | 47063 | 0.009944 | 0.072477 | 0.000000 | 3LHON-unsorted_d0-0_d0 | d0_lhon_r3 | 0.082421 |
| 9 | A7 | 62 | 140 | 12 | 12 | 5 | 0 | 416 | 8 | 6 | 101 | 3466 | 4127 | 0.055973 | 0.104192 | 0.000000 | 1Silent-unsorted_d0-0_d0 | d0_silent_r1 | 0.160165 |
| 10 | A8 | 409 | 243 | 5 | 18 | 4 | 0 | 2707 | 16 | 7 | 1281 | 121785 | 125194 | 0.005424 | 0.021806 | 0.000000 | 2Silent-unsorted_d0-0_d0 | d0_silent_r2 | 0.027230 |
| 11 | A9 | 30 | 76 | 0 | 4 | 4 | 0 | 340 | 5 | 1 | 101 | 4258 | 4718 | 0.024163 | 0.073336 | 0.000000 | 3Silent-unsorted_d0-0_d0 | d0_silent_r3 | 0.097499 |
| 12 | B1 | 341 | 483 | 17 | 40 | 11 | 0 | 21053 | 45 | 21 | 1569 | 115720 | 137731 | 0.006476 | 0.153335 | 0.000000 | 1Silent-unsorted_d5-0_d0 | d5_unsort_silent_r1 | 0.159812 |
| 13 | B10 | 81 | 269 | 17 | 31 | 12 | 0 | 916 | 22 | 3 | 93 | 2012 | 3363 | 0.121915 | 0.279810 | 0.000000 | 1LHON-low_d5-0_d0 | d5_low_lhon_r1 | 0.401725 |
| 14 | B11 | 1386 | 10825 | 780 | 1285 | 609 | 0 | 17871 | 730 | 277 | 4754 | 300132 | 333895 | 0.044580 | 0.056539 | 0.000000 | 2LHON-low_d5-0_d0 | d5_low_lhon_r2 | 0.101119 |
| 15 | B12 | 1722 | 11051 | 628 | 821 | 496 | 0 | 21635 | 687 | 331 | 5070 | 351290 | 388661 | 0.037868 | 0.058285 | 0.000000 | 3LHON-low_d5-0_d0 | d5_low_lhon_r3 | 0.096153 |
| 16 | B2 | 336 | 488 | 192 | 28 | 14 | 0 | 20311 | 35 | 17 | 1637 | 119882 | 141303 | 0.007487 | 0.144109 | 0.000000 | 2Silent-unsorted_d5-0_d0 | d5_unsort_silent_r2 | 0.151596 |
| 17 | B3 | 85 | 189 | 21 | 22 | 10 | 0 | 2409 | 27 | 4 | 202 | 11294 | 14061 | 0.023256 | 0.173530 | 0.000000 | 3Silent-unsorted_d5-0_d0 | d5_unsort_silent_r3 | 0.196785 |
| 18 | B4 | 6286 | 165698 | 15446 | 19788 | 11901 | 0 | 83167 | 12670 | 2370 | 13253 | 49682 | 367008 | 0.597041 | 0.267588 | 0.000000 | 1LHON-high_d5-0_d0 | d5_high_lhon_r1 | 0.864630 |
| 19 | B5 | 6114 | 152016 | 14564 | 18739 | 10748 | 0 | 79486 | 12262 | 2158 | 12658 | 60647 | 356734 | 0.566756 | 0.263238 | 0.000000 | 2LHON-high_d5-0_d0 | d5_high_lhon_r2 | 0.829994 |
| 20 | B6 | 5701 | 140764 | 16662 | 25153 | 12162 | 0 | 69995 | 14884 | 1997 | 14582 | 78981 | 366299 | 0.547209 | 0.237172 | 0.000000 | 3LHON-high_d5-0_d0 | d5_high_lhon_r3 | 0.784381 |
| 21 | B7 | 720 | 1666 | 67 | 173 | 43 | 0 | 244398 | 194 | 155 | 6326 | 179863 | 427279 | 0.006247 | 0.572804 | 0.000000 | 1Silent-high_d5-0_d0 | d5_high_silent_r1 | 0.579050 |
| 22 | B8 | 575 | 1042 | 38 | 97 | 30 | 0 | 181182 | 120 | 126 | 4938 | 195178 | 378388 | 0.004709 | 0.479476 | 0.000000 | 2Silent-high_d5-0_d0 | d5_high_silent_r2 | 0.484186 |
| 23 | B9 | 466 | 894 | 28 | 74 | 23 | 0 | 190170 | 131 | 144 | 4854 | 178020 | 369950 | 0.004014 | 0.514786 | 0.000000 | 3Silent-high_d5-0_d0 | d5_high_silent_r3 | 0.518800 |
| 24 | C1 | 573 | 326 | 4 | 22 | 5 | 0 | 10093 | 21 | 7 | 3862 | 366936 | 377987 | 0.002460 | 0.026776 | 0.000000 | 1Silent-low_d5-0_d0 | d5_low_silent_r1 | 0.029236 |
| 25 | C10 | 393 | 272 | 5 | 8 | 11 | 0 | 51445 | 24 | 25 | 3592 | 305541 | 357724 | 0.001926 | 0.143949 | 0.000000 | 1Silent-unsorted_d10-GLU_d4 | none | 0.145875 |
| 26 | C11 | 540 | 296 | 4 | 20 | 2 | 0 | 52679 | 30 | 32 | 3802 | 318857 | 372460 | 0.002314 | 0.141602 | 0.000000 | 2Silent-unsorted_d10-GLU_d4 | none | 0.143916 |
| 27 | C12 | 350 | 234 | 7 | 10 | 11 | 0 | 28112 | 23 | 17 | 2041 | 180424 | 209188 | 0.002926 | 0.134578 | 0.000000 | 3Silent-unsorted_d10-GLU_d4 | none | 0.137503 |
| 28 | C2 | 114 | 110 | 5 | 5 | 3 | 0 | 2125 | 6 | 4 | 754 | 67089 | 69461 | 0.003412 | 0.030737 | 0.000000 | 2Silent-low_d5-0_d0 | d5_low_silent_r2 | 0.034149 |
| 29 | C3 | 491 | 237 | 3 | 4 | 6 | 0 | 10957 | 18 | 9 | 4272 | 406615 | 418340 | 0.001771 | 0.026256 | 0.000000 | 3Silent-low_d5-0_d0 | d5_low_silent_r3 | 0.028027 |
| 30 | C4 | 4779 | 54458 | 1928 | 3235 | 2288 | 0 | 90474 | 2940 | 1536 | 6828 | 112624 | 274262 | 0.243154 | 0.346202 | 0.000000 | 1LHON-med_d5-0_d0 | d5_med_lhon_r1 | 0.589356 |
| 31 | C5 | 5587 | 70711 | 2338 | 4181 | 2982 | 0 | 123057 | 3473 | 2171 | 7680 | 140079 | 354579 | 0.241974 | 0.362968 | 0.000000 | 2LHON-med_d5-0_d0 | d5_med_lhon_r2 | 0.604943 |
| 32 | C6 | 5235 | 75393 | 2891 | 4888 | 3495 | 0 | 121636 | 4212 | 2124 | 8233 | 159972 | 379846 | 0.241945 | 0.336905 | 0.000000 | 3LHON-med_d5-0_d0 | d5_med_lhon_r3 | 0.578850 |
| 33 | C7 | 2017 | 16850 | 385 | 586 | 632 | 0 | 31892 | 532 | 628 | 3684 | 240855 | 294377 | 0.069537 | 0.112278 | 0.000000 | 1LHON-unsorted_d10-GLU_d4 | none | 0.181814 |
| 34 | C8 | 2225 | 23496 | 620 | 715 | 848 | 0 | 42396 | 772 | 793 | 4520 | 286123 | 357988 | 0.077947 | 0.122800 | 0.000000 | 2LHON-unsorted_d10-GLU_d4 | none | 0.200747 |
| 35 | C9 | 2163 | 23226 | 575 | 713 | 830 | 0 | 43558 | 835 | 782 | 4021 | 255424 | 328106 | 0.083836 | 0.137684 | 0.000000 | 3LHON-unsorted_d10-GLU_d4 | none | 0.221520 |
| 36 | D1 | 553 | 4062 | 98 | 155 | 140 | 0 | 8904 | 152 | 142 | 733 | 51495 | 65701 | 0.076224 | 0.139998 | 0.000000 | 1LHON-unsorted_d10-GAL_d4 | none | 0.216222 |
| 37 | D10 | 541 | 613 | 11 | 35 | 13 | 0 | 182086 | 85 | 77 | 4615 | 237922 | 421383 | 0.002879 | 0.432500 | 0.000000 | 2Silent-high_d10-GLU_d4 | none | 0.435378 |
| 38 | D11 | 609 | 798 | 10 | 46 | 15 | 0 | 187402 | 89 | 121 | 4762 | 203848 | 392938 | 0.003761 | 0.477460 | 0.000000 | 3Silent-high_d10-GLU_d4 | none | 0.481221 |
| 39 | D12 | 5534 | 69935 | 4121 | 5387 | 3524 | 0 | 83379 | 5566 | 1513 | 7766 | 236222 | 415181 | 0.213162 | 0.217876 | 0.000000 | 1LHON-high_d10-GAL_d4 | none | 0.431039 |
| 40 | D2 | 972 | 8272 | 166 | 300 | 292 | 0 | 17881 | 258 | 359 | 1595 | 110665 | 139165 | 0.071872 | 0.132921 | 0.000000 | 2LHON-unsorted_d10-GAL_d4 | none | 0.204793 |
| 41 | D3 | 1815 | 14652 | 259 | 497 | 504 | 0 | 37305 | 460 | 635 | 3496 | 253123 | 309250 | 0.057323 | 0.124171 | 0.000000 | 3LHON-unsorted_d10-GAL_d4 | none | 0.181494 |
| 42 | D4 | 1000 | 739 | 13 | 68 | 19 | 0 | 82856 | 65 | 55 | 4430 | 365728 | 450543 | 0.004082 | 0.184169 | 0.000000 | 1Silent-unsorted_d10-GAL_d4 | none | 0.188251 |
| 43 | D5 | 687 | 615 | 17 | 42 | 16 | 0 | 46946 | 35 | 54 | 3320 | 274895 | 323307 | 0.004259 | 0.145481 | 0.000000 | 2Silent-unsorted_d10-GAL_d4 | none | 0.149740 |
| 44 | D6 | 722 | 780 | 28 | 61 | 31 | 0 | 43519 | 65 | 34 | 2933 | 251424 | 296664 | 0.005467 | 0.147028 | 0.000000 | 3Silent-unsorted_d10-GAL_d4 | none | 0.152496 |
| 45 | D7 | 8789 | 136233 | 9618 | 14860 | 8604 | 0 | 107148 | 10335 | 2667 | 14039 | 180924 | 479178 | 0.371687 | 0.250742 | 0.000000 | 1LHON-high_d10-GLU_d4 | none | 0.622428 |
| 46 | D8 | 6893 | 101981 | 6578 | 10742 | 6472 | 0 | 90273 | 7423 | 2095 | 11067 | 202062 | 434519 | 0.305317 | 0.229659 | 0.000000 | 2LHON-high_d10-GLU_d4 | none | 0.534975 |
| 47 | D9 | 466 | 747 | 18 | 56 | 15 | 0 | 236025 | 110 | 120 | 5070 | 199278 | 436835 | 0.002981 | 0.540833 | 0.000000 | 1Silent-high_d10-GLU_d4 | none | 0.543814 |
| 48 | E1 | 4709 | 51531 | 2521 | 3898 | 2547 | 0 | 74597 | 4009 | 1369 | 6828 | 261994 | 407175 | 0.160142 | 0.196414 | 0.000000 | 2LHON-high_d10-GAL_d4 | none | 0.356557 |
| 49 | E10 | 2436 | 22975 | 596 | 1147 | 842 | 0 | 55377 | 1246 | 823 | 2918 | 86217 | 171659 | 0.163091 | 0.334652 | 0.000000 | 3LHON-med_d10-GAL_d4 | none | 0.497743 |
| 50 | E11 | 1609 | 12848 | 667 | 778 | 563 | 0 | 27778 | 726 | 401 | 4970 | 454386 | 499756 | 0.032946 | 0.057838 | 0.000000 | 1LHON-low_d10-GLU_d4 | none | 0.090784 |
| 51 | E12 | 1756 | 10807 | 489 | 628 | 422 | 0 | 25713 | 638 | 308 | 4632 | 460323 | 501084 | 0.028143 | 0.053203 | 0.000000 | 3LHON-low_d10-GLU_d4 | none | 0.081346 |
| 52 | E2 | 284 | 414 | 2 | 31 | 7 | 0 | 174186 | 47 | 87 | 3510 | 156357 | 331415 | 0.002227 | 0.525987 | 0.000000 | 1Silent-high_d10-GAL_d4 | none | 0.528214 |
| 53 | E3 | 304 | 370 | 8 | 13 | 7 | 0 | 181750 | 54 | 97 | 4182 | 227604 | 410207 | 0.001711 | 0.443437 | 0.000000 | 2Silent-high_d10-GAL_d4 | none | 0.445148 |
| 54 | E4 | 941 | 1901 | 71 | 172 | 44 | 0 | 57309 | 180 | 108 | 3140 | 77485 | 138211 | 0.022639 | 0.416732 | 0.000000 | 3Silent-high_d10-GAL_d4 | none | 0.439372 |
| 55 | E5 | 5918 | 53563 | 1293 | 2296 | 1899 | 0 | 136771 | 2919 | 2035 | 7237 | 201009 | 407703 | 0.159354 | 0.347618 | 0.000000 | 1LHON-med_d10-GLU_d4 | none | 0.506972 |
| 56 | E6 | 6120 | 64976 | 1776 | 2889 | 2208 | 0 | 153865 | 3459 | 2185 | 8058 | 186054 | 423532 | 0.184092 | 0.376616 | 0.000000 | 2LHON-med_d10-GLU_d4 | none | 0.560709 |
| 57 | E7 | 6890 | 69399 | 2046 | 3278 | 2503 | 0 | 151583 | 4002 | 2302 | 8694 | 209936 | 451939 | 0.186122 | 0.349355 | 0.000000 | 3LHON-med_d10-GLU_d4 | none | 0.535477 |
| 58 | E8 | 510 | 4945 | 110 | 219 | 139 | 0 | 12103 | 265 | 170 | 703 | 17250 | 35711 | 0.165859 | 0.351096 | 0.000000 | 1LHON-med_d10-GAL_d4 | none | 0.516956 |
| 59 | E9 | 1578 | 15134 | 344 | 634 | 544 | 0 | 37366 | 668 | 555 | 1852 | 45710 | 102533 | 0.177835 | 0.376357 | 0.000000 | 2LHON-med_d10-GAL_d4 | none | 0.554192 |
| 60 | F1 | 1148 | 618 | 21 | 40 | 20 | 0 | 7469 | 57 | 25 | 2955 | 230307 | 239705 | 0.007705 | 0.031501 | 0.000000 | 1Silent-low_d10-GLU_d4 | none | 0.039207 |
| 61 | F10 | 0 | 0 | 0 | 0 | 0 | 59541 | 0 | 0 | 0 | 3234 | 275163 | 334704 | 0.000000 | 0.000000 | 0.177892 | None-unsorted_d0-None_d0 | none | 0.000000 |
| 62 | F11 | 0 | 0 | 0 | 0 | 0 | 34403 | 0 | 0 | 0 | 4465 | 277537 | 311940 | 0.000000 | 0.000000 | 0.110287 | None-unsorted_d0-None_d0 | none | 0.000000 |
| 63 | F12 | 0 | 0 | 0 | 0 | 0 | 70741 | 0 | 0 | 0 | 3383 | 119615 | 190356 | 0.000000 | 0.000000 | 0.371625 | None-unsorted_d0-None_d0 | none | 0.000000 |
| 64 | F2 | 1021 | 343 | 11 | 31 | 6 | 0 | 10511 | 36 | 20 | 4148 | 369187 | 381166 | 0.003704 | 0.027723 | 0.000000 | 2Silent-low_d10-GLU_d4 | none | 0.031427 |
| 65 | F3 | 655 | 206 | 4 | 16 | 8 | 0 | 7542 | 15 | 8 | 3414 | 332111 | 340565 | 0.002610 | 0.022213 | 0.000000 | 3Silent-low_d10-GLU_d4 | none | 0.024823 |
| 66 | F4 | 1004 | 2439 | 71 | 140 | 82 | 0 | 8947 | 122 | 88 | 2543 | 194648 | 207541 | 0.018001 | 0.044121 | 0.000000 | 1LHON-low_d10-GAL_d4 | none | 0.062123 |
| 67 | F5 | 1030 | 2796 | 88 | 97 | 79 | 0 | 10639 | 174 | 110 | 2878 | 233426 | 248439 | 0.016463 | 0.043967 | 0.000000 | 3LHON-low_d10-GAL_d4 | none | 0.060429 |
| 68 | F6 | 807 | 517 | 12 | 53 | 13 | 0 | 6161 | 48 | 17 | 2413 | 192850 | 200478 | 0.006993 | 0.031056 | 0.000000 | 1Silent-low_d10-GAL_d4 | none | 0.038049 |
| 69 | F7 | 935 | 459 | 14 | 28 | 12 | 0 | 8103 | 34 | 24 | 2866 | 242579 | 252188 | 0.005742 | 0.032361 | 0.000000 | 2Silent-low_d10-GAL_d4 | none | 0.038103 |
| 70 | F8 | 520 | 256 | 5 | 22 | 8 | 0 | 4375 | 25 | 13 | 1676 | 154140 | 159364 | 0.005089 | 0.027691 | 0.000000 | 3Silent-low_d10-GAL_d4 | none | 0.032780 |
| 71 | F9 | 0 | 0 | 0 | 0 | 0 | 2825 | 0 | 0 | 0 | 2574 | 8340 | 11165 | 0.000000 | 0.000000 | 0.253023 | None-unsorted_d0-None_d0 | none | 0.000000 |
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(10,4))
xorder = ['d0_lhon_r1', 'd0_lhon_r2', 'd0_lhon_r3',
'd5_low_lhon_r1', 'd5_low_lhon_r3',
'd5_med_lhon_r1', 'd5_med_lhon_r2', 'd5_med_lhon_r3',
'd5_high_lhon_r1', 'd5_high_lhon_r2', 'd5_high_lhon_r3',
'd5_unsort_lhon_r1', 'd5_unsort_lhon_r2', 'd5_unsort_lhon_r3',
'd0_silent_r1', 'd0_silent_r2', 'd0_silent_r3',
'd5_low_silent_r1', 'd5_low_silent_r2', 'd5_low_silent_r3',
'd5_high_silent_r1', 'd5_high_silent_r2', 'd5_high_silent_r3',
'd5_unsort_silent_r1', 'd5_unsort_silent_r2', 'd5_unsort_silent_r3']
seaborn.boxplot(data=valid_cells, x='condition', y='total_het', ax=axes, order=xorder, showfliers=False)
seaborn.stripplot(data=valid_cells, x='condition', y='total_het', dodge=True, s=1, order=xorder, ax=axes)
axes.plot(numpy.arange(len(xorder)), valid_cells.groupby('condition')['total_het'].mean()[xorder],
color='k', marker='^', linestyle='', zorder=100, label='mean het estimate')
for patch in axes.artists:
r, g, b, a = patch.get_facecolor()
patch.set_facecolor((r, g, b, 0))
patch.set_edgecolor((r, g, b, 1))
axes.set_xticklabels(axes.get_xticklabels(), ha='right', rotation=45)
axes.set_ylim((-0.03, 1.03))
axes.set_yticks(numpy.arange(0, 1.1, 0.1))
xpos = numpy.arange(len(xorder))
bulk_hets = []
for sname in xorder:
bulk_hets.append(bulk_estimates.loc[bulk_estimates['sci-lite_sample'] == sname, 'TOTAL_het'].to_numpy()[0])
axes.plot(xpos, bulk_hets, color='k', marker='*', linestyle='', zorder=100, label='bulk het estimate')
axes.legend(bbox_to_anchor=[1,1])
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(6,4))
xorder = ['d0_lhon_r1', 'd0_lhon_r2', 'd0_lhon_r3',
'd5_low_lhon_r1', 'd5_low_lhon_r3',
'd5_med_lhon_r1', 'd5_med_lhon_r2', 'd5_med_lhon_r3',
'd5_high_lhon_r1', 'd5_high_lhon_r2', 'd5_high_lhon_r3',
'd5_unsort_lhon_r1', 'd5_unsort_lhon_r2', 'd5_unsort_lhon_r3']
seaborn.boxplot(data=valid_cells, x='condition', y='LHON_het', ax=axes, order=xorder, showfliers=False)
seaborn.stripplot(data=valid_cells, x='condition', y='LHON_het', dodge=True, s=1, order=xorder, ax=axes)
axes.plot(numpy.arange(len(xorder)), valid_cells.groupby('condition')['LHON_het'].mean()[xorder],
color='k', marker='^', linestyle='', zorder=100, label='mean het estimate')
for patch in axes.artists:
r, g, b, a = patch.get_facecolor()
patch.set_facecolor((r, g, b, 0))
patch.set_edgecolor((r, g, b, 1))
axes.set_xticklabels(axes.get_xticklabels(), ha='right', rotation=45)
axes.set_ylim((-0.03, 1.03))
axes.set_yticks(numpy.arange(0, 1.1, 0.1))
xpos = numpy.arange(len(xorder))
bulk_hets = []
for sname in xorder:
bulk_hets.append(bulk_estimates.loc[bulk_estimates['sci-lite_sample'] == sname, 'LHON_het'].to_numpy()[0])
axes.plot(xpos, bulk_hets, color='k', marker='*', linestyle='', zorder=100, label='bulk het estimate')
axes.legend(bbox_to_anchor=[1,1])
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(6,4))
xorder = ['d0_lhon_r1', 'd0_lhon_r2', 'd0_lhon_r3',
'd5_low_lhon_r1', 'd5_low_lhon_r3',
'd5_med_lhon_r1', 'd5_med_lhon_r2', 'd5_med_lhon_r3',
'd5_high_lhon_r1', 'd5_high_lhon_r2', 'd5_high_lhon_r3',
'd5_unsort_lhon_r1', 'd5_unsort_lhon_r2', 'd5_unsort_lhon_r3']
seaborn.boxplot(data=valid_cells, x='condition', y='SILENT_ONLY_het', ax=axes, order=xorder, showfliers=False)
seaborn.stripplot(data=valid_cells, x='condition', y='SILENT_ONLY_het', dodge=True, s=1, order=xorder, ax=axes)
axes.plot(numpy.arange(len(xorder)), valid_cells.groupby('condition')['SILENT_ONLY_het'].mean()[xorder],
color='k', marker='^', linestyle='', zorder=100, label='mean het estimate')
for patch in axes.artists:
r, g, b, a = patch.get_facecolor()
patch.set_facecolor((r, g, b, 0))
patch.set_edgecolor((r, g, b, 1))
axes.set_xticklabels(axes.get_xticklabels(), ha='right', rotation=45)
axes.set_ylim((-0.03, 1.03))
axes.set_yticks(numpy.arange(0, 1.1, 0.1))
xpos = numpy.arange(len(xorder))
bulk_hets = []
for sname in xorder:
bulk_hets.append(bulk_estimates.loc[bulk_estimates['sci-lite_sample'] == sname, 'SILENT_het'].to_numpy()[0])
axes.plot(xpos, bulk_hets, color='k', marker='*', linestyle='', zorder=100, label='bulk het estimate')
axes.legend(bbox_to_anchor=[1,1])
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(6,4))
xorder = ['d0_silent_r1', 'd0_silent_r2', 'd0_silent_r3',
'd5_low_silent_r1', 'd5_low_silent_r2', 'd5_low_silent_r3',
'd5_high_silent_r1', 'd5_high_silent_r2', 'd5_high_silent_r3',
'd5_unsort_silent_r1', 'd5_unsort_silent_r2', 'd5_unsort_silent_r3']
seaborn.boxplot(data=valid_cells, x='condition', y='SILENT_ONLY_het', ax=axes, order=xorder, showfliers=False)
seaborn.stripplot(data=valid_cells, x='condition', y='SILENT_ONLY_het', dodge=True, s=1, order=xorder, ax=axes)
axes.plot(numpy.arange(len(xorder)), valid_cells.groupby('condition')['SILENT_ONLY_het'].mean()[xorder],
color='k', marker='^', linestyle='', zorder=100, label='mean het estimate')
for patch in axes.artists:
r, g, b, a = patch.get_facecolor()
patch.set_facecolor((r, g, b, 0))
patch.set_edgecolor((r, g, b, 1))
axes.set_xticklabels(axes.get_xticklabels(), ha='right', rotation=45)
axes.set_ylim((-0.03, 1.03))
axes.set_yticks(numpy.arange(0, 1.1, 0.1))
xpos = numpy.arange(len(xorder))
bulk_hets = []
for sname in xorder:
bulk_hets.append(bulk_estimates.loc[bulk_estimates['sci-lite_sample'] == sname, 'SILENT_het'].to_numpy()[0])
axes.plot(xpos, bulk_hets, color='k', marker='*', linestyle='', zorder=100, label='bulk het estimate')
axes.legend(bbox_to_anchor=[1,1])
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(6,4))
xorder = ['d0_silent_r1', 'd0_silent_r2', 'd0_silent_r3',
'd5_low_silent_r1', 'd5_low_silent_r2', 'd5_low_silent_r3',
'd5_high_silent_r1', 'd5_high_silent_r2', 'd5_high_silent_r3',
'd5_unsort_silent_r1', 'd5_unsort_silent_r2', 'd5_unsort_silent_r3']
seaborn.boxplot(data=valid_cells, x='condition', y='LHON_het', ax=axes, order=xorder, showfliers=False)
seaborn.stripplot(data=valid_cells, x='condition', y='LHON_het', dodge=True, s=1, order=xorder, ax=axes)
axes.plot(numpy.arange(len(xorder)), valid_cells.groupby('condition')['LHON_het'].mean()[xorder],
color='k', marker='^', linestyle='', zorder=100, label='mean het estimate')
for patch in axes.artists:
r, g, b, a = patch.get_facecolor()
patch.set_facecolor((r, g, b, 0))
patch.set_edgecolor((r, g, b, 1))
axes.set_xticklabels(axes.get_xticklabels(), ha='right', rotation=45)
axes.set_ylim((-0.03, 1.03))
axes.set_yticks(numpy.arange(0, 1.1, 0.1))
xpos = numpy.arange(len(xorder))
bulk_hets = []
for sname in xorder:
bulk_hets.append(bulk_estimates.loc[bulk_estimates['sci-lite_sample'] == sname, 'LHON_het'].to_numpy()[0])
axes.plot(xpos, bulk_hets, color='k', marker='*', linestyle='', zorder=100, label='bulk het estimate')
axes.legend(bbox_to_anchor=[1,1])
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(10,4))
xorder = ['d0_lhon_r1', 'd0_lhon_r2', 'd0_lhon_r3',
'd5_low_lhon_r1', 'd5_low_lhon_r3',
'd5_med_lhon_r1', 'd5_med_lhon_r2', 'd5_med_lhon_r3',
'd5_high_lhon_r1', 'd5_high_lhon_r2', 'd5_high_lhon_r3',
'd5_unsort_lhon_r1', 'd5_unsort_lhon_r2', 'd5_unsort_lhon_r3',
'd0_silent_r1', 'd0_silent_r2', 'd0_silent_r3',
'd5_low_silent_r1', 'd5_low_silent_r2', 'd5_low_silent_r3',
'd5_high_silent_r1', 'd5_high_silent_r2', 'd5_high_silent_r3',
'd5_unsort_silent_r1', 'd5_unsort_silent_r2', 'd5_unsort_silent_r3']
seaborn.boxplot(data=valid_cells, x='condition', y='LHON_het', ax=axes, order=xorder, showfliers=False)
seaborn.stripplot(data=valid_cells, x='condition', y='LHON_het', dodge=True, s=1, order=xorder, ax=axes)
axes.plot(numpy.arange(len(xorder)), valid_cells.groupby('condition')['LHON_het'].mean()[xorder],
color='k', marker='^', linestyle='', zorder=100, label='mean het estimate')
for patch in axes.artists:
r, g, b, a = patch.get_facecolor()
patch.set_facecolor((r, g, b, 0))
patch.set_edgecolor((r, g, b, 1))
axes.set_xticklabels(axes.get_xticklabels(), ha='right', rotation=45)
axes.set_ylim((-0.03, 1.03))
axes.set_yticks(numpy.arange(0, 1.1, 0.1))
xpos = numpy.arange(len(xorder))
bulk_hets = []
for sname in xorder:
bulk_hets.append(bulk_estimates.loc[bulk_estimates['sci-lite_sample'] == sname, 'LHON_het'].to_numpy()[0])
axes.plot(xpos, bulk_hets, color='k', marker='*', linestyle='', zorder=100, label='bulk het estimate')
axes.legend(bbox_to_anchor=[1,1])
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(10,4))
xorder = ['d0_lhon_r1', 'd0_lhon_r2', 'd0_lhon_r3',
'd5_low_lhon_r1', 'd5_low_lhon_r3',
'd5_med_lhon_r1', 'd5_med_lhon_r2', 'd5_med_lhon_r3',
'd5_high_lhon_r1', 'd5_high_lhon_r2', 'd5_high_lhon_r3',
'd5_unsort_lhon_r1', 'd5_unsort_lhon_r2', 'd5_unsort_lhon_r3',
'd0_silent_r1', 'd0_silent_r2', 'd0_silent_r3',
'd5_low_silent_r1', 'd5_low_silent_r2', 'd5_low_silent_r3',
'd5_high_silent_r1', 'd5_high_silent_r2', 'd5_high_silent_r3',
'd5_unsort_silent_r1', 'd5_unsort_silent_r2', 'd5_unsort_silent_r3']
seaborn.boxplot(data=valid_cells, x='condition', y='SILENT_ONLY_het', ax=axes, order=xorder, showfliers=False)
seaborn.stripplot(data=valid_cells, x='condition', y='SILENT_ONLY_het', dodge=True, s=1, order=xorder, ax=axes)
axes.plot(numpy.arange(len(xorder)), valid_cells.groupby('condition')['SILENT_ONLY_het'].mean()[xorder],
color='k', marker='^', linestyle='', zorder=100, label='mean het estimate')
for patch in axes.artists:
r, g, b, a = patch.get_facecolor()
patch.set_facecolor((r, g, b, 0))
patch.set_edgecolor((r, g, b, 1))
axes.set_xticklabels(axes.get_xticklabels(), ha='right', rotation=45)
axes.set_ylim((-0.03, 1.03))
axes.set_yticks(numpy.arange(0, 1.1, 0.1))
xpos = numpy.arange(len(xorder))
bulk_hets = []
for sname in xorder:
bulk_hets.append(bulk_estimates.loc[bulk_estimates['sci-lite_sample'] == sname, 'SILENT_het'].to_numpy()[0])
axes.plot(xpos, bulk_hets, color='k', marker='*', linestyle='', zorder=100, label='bulk het estimate')
axes.legend(bbox_to_anchor=[1,1])
fig.tight_layout()
valid_cells['condition_no_rep'] = valid_cells['condition'].str.split('_r', expand=True)[0]
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(10,4))
xorder = ['d0_lhon', 'd5_low_lhon', 'd5_med_lhon', 'd5_high_lhon', 'd5_unsort_lhon',
'd0_silent', 'd5_low_silent', 'd5_high_silent', 'd5_unsort_silent']
seaborn.boxplot(data=valid_cells, x='condition_no_rep', y='LHON_het', ax=axes, order=xorder, showfliers=False)
seaborn.stripplot(data=valid_cells, x='condition_no_rep', y='LHON_het', dodge=True, s=1, order=xorder, ax=axes)
axes.plot(numpy.arange(len(xorder)), valid_cells.groupby('condition_no_rep')['LHON_het'].mean()[xorder],
color='k', marker='^', linestyle='', zorder=100, label='mean het estimate')
xpos = numpy.arange(len(xorder))
bulk_hets = []
for sname in xorder:
sidx = bulk_estimates['sci-lite_sample'].str.startswith(sname)
bulk_hets.append(bulk_estimates.loc[sidx, ['LHON', 'LHON_BY1', 'LHON_BY2',
'LHON_BY3', 'LHON_BY4']].to_numpy().sum()
/ bulk_estimates.loc[sidx, 'TOTAL'].to_numpy().sum())
axes.plot(xpos, bulk_hets, color='k', marker='*', linestyle='', zorder=100, label='bulk het estimate')
for patch in axes.artists:
r, g, b, a = patch.get_facecolor()
patch.set_facecolor((r, g, b, 0))
patch.set_edgecolor((r, g, b, 1))
axes.set_xticklabels(axes.get_xticklabels(), ha='right', rotation=45)
axes.set_ylim((-0.03, 1.03))
axes.set_yticks(numpy.arange(0, 1.1, 0.1))
axes.legend(bbox_to_anchor=[1,1])
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=1, ncols=1, figsize=(10,4))
xorder = ['d0_lhon', 'd5_low_lhon', 'd5_med_lhon', 'd5_high_lhon', 'd5_unsort_lhon',
'd0_silent', 'd5_low_silent', 'd5_high_silent', 'd5_unsort_silent']
seaborn.boxplot(data=valid_cells, x='condition_no_rep', y='SILENT_ONLY_het', ax=axes, order=xorder, showfliers=False)
seaborn.stripplot(data=valid_cells, x='condition_no_rep', y='SILENT_ONLY_het', dodge=True, s=1, order=xorder, ax=axes)
axes.plot(numpy.arange(len(xorder)), valid_cells.groupby('condition_no_rep')['SILENT_ONLY_het'].mean()[xorder],
color='k', marker='^', linestyle='', zorder=100, label='mean het estimate')
xpos = numpy.arange(len(xorder))
bulk_hets = []
for sname in xorder:
sidx = bulk_estimates['sci-lite_sample'].str.startswith(sname)
bulk_hets.append(bulk_estimates.loc[sidx, ['SILENT', 'SILENT_BY1', 'SILENT_BY2']].to_numpy().sum()
/ bulk_estimates.loc[sidx, 'TOTAL'].to_numpy().sum())
axes.plot(xpos, bulk_hets, color='k', marker='*', linestyle='', zorder=100, label='bulk het estimate')
for patch in axes.artists:
r, g, b, a = patch.get_facecolor()
patch.set_facecolor((r, g, b, 0))
patch.set_edgecolor((r, g, b, 1))
axes.set_xticklabels(axes.get_xticklabels(), ha='right', rotation=45)
axes.set_ylim((-0.03, 1.03))
axes.set_yticks(numpy.arange(0, 1.1, 0.1))
axes.legend(bbox_to_anchor=[1,1])
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=3, ncols=3, figsize=(12,12), sharey=True, sharex=True)
xorder = ['d0_lhon', 'd5_low_lhon', 'd5_med_lhon', 'd5_high_lhon', 'd5_unsort_lhon',
'd0_silent', 'd5_low_silent', 'd5_high_silent', 'd5_unsort_silent']
for idx, cond in enumerate(xorder):
ax_idx = (idx//3, idx%3)
seaborn.scatterplot(data=valid_cells.loc[valid_cells['condition_no_rep'] == cond],
x='LHON_het', y='SILENT_ONLY_het', color=f'C{idx}', s=5, ax=axes[ax_idx])
axes[ax_idx].set_xlim((-0.05, 1.05))
axes[ax_idx].set_ylim((-0.05, 1.05))
axes[ax_idx].set_title(cond)
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=3, ncols=3, figsize=(12,12), sharey=True, sharex=True)
xorder = ['d0_lhon', 'd5_low_lhon', 'd5_med_lhon', 'd5_high_lhon', 'd5_unsort_lhon',
'd0_silent', 'd5_low_silent', 'd5_high_silent', 'd5_unsort_silent']
for idx, cond in enumerate(xorder):
ax_idx = (idx//3, idx%3)
seaborn.kdeplot(data=valid_cells.loc[valid_cells['condition_no_rep'] == cond],
x='LHON_het', y='SILENT_ONLY_het', color=f'C{idx}', ax=axes[ax_idx])
axes[ax_idx].set_xlim((-0.05, 1.05))
axes[ax_idx].set_ylim((-0.05, 1.05))
axes[ax_idx].set_title(cond)
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=3, ncols=3, figsize=(12,12), sharey=True, sharex=True)
xorder = ['d0_lhon', 'd5_low_lhon', 'd5_med_lhon', 'd5_high_lhon', 'd5_unsort_lhon',
'd0_silent', 'd5_low_silent', 'd5_high_silent', 'd5_unsort_silent']
for idx, cond in enumerate(xorder):
ax_idx = (idx//3, idx%3)
to_plot_subset = valid_cells.loc[valid_cells['condition_no_rep'] == cond]
seaborn.scatterplot(data=to_plot_subset, x='LHON_het', y='SILENT_ONLY_het',
color=f'C{idx}', s=5, ax=axes[ax_idx])
xvals = numpy.arange(0,0.8,0.05)
yvals = -1*xvals + 0.55
above_line = [(-1*l_het + 0.55) < s_het
for l_het, s_het in to_plot_subset[['LHON_het', 'SILENT_ONLY_het']].to_numpy()]
pct_above = round((numpy.sum(above_line)/len(above_line))*100, 2)
axes[ax_idx].plot(xvals, yvals, color='k', linewidth=2)
axes[ax_idx].set_xlim((-0.05, 1.05))
axes[ax_idx].set_ylim((-0.05, 1.05))
axes[ax_idx].set_title(f'{cond}, {pct_above} % above line')
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=3, ncols=3, figsize=(12,12), sharey=True, sharex=True)
xorder = ['d0_lhon', 'd5_low_lhon', 'd5_med_lhon', 'd5_high_lhon', 'd5_unsort_lhon',
'd0_silent', 'd5_low_silent', 'd5_high_silent', 'd5_unsort_silent']
for idx, cond in enumerate(xorder):
ax_idx = (idx//3, idx%3)
to_plot_subset = valid_cells.loc[valid_cells['condition_no_rep'] == cond]
seaborn.kdeplot(data=to_plot_subset, x='LHON_het', y='SILENT_ONLY_het',
color=f'C{idx}', ax=axes[ax_idx])
xvals = numpy.arange(0,0.8,0.05)
yvals = -1*xvals + 0.55
above_line = [(-1*l_het + 0.55) < s_het
for l_het, s_het in to_plot_subset[['LHON_het', 'SILENT_ONLY_het']].to_numpy()]
pct_above = round((numpy.sum(above_line)/len(above_line))*100, 2)
axes[ax_idx].plot(xvals, yvals, color='k', linewidth=2)
axes[ax_idx].set_xlim((-0.05, 1.05))
axes[ax_idx].set_ylim((-0.05, 1.05))
axes[ax_idx].set_title(f'{cond}, {pct_above} % above line')
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=3, ncols=3, figsize=(12,12), sharey=True, sharex=True)
xorder = ['d0_lhon', 'd5_low_lhon', 'd5_med_lhon', 'd5_high_lhon', 'd5_unsort_lhon',
'd0_silent', 'd5_low_silent', 'd5_high_silent', 'd5_unsort_silent']
for idx, cond in enumerate(xorder):
ax_idx = (idx//3, idx%3)
to_plot_subset = valid_cells.loc[valid_cells['condition_no_rep'] == cond]
seaborn.scatterplot(data=to_plot_subset, x='LHON_het', y='SILENT_ONLY_het',
color=f'C{idx}', s=5, ax=axes[ax_idx])
xvals = [0,0.2,0.2]
yvals = [0.2, 0.2, 0]
above_line = [(s_het > 0.2) or (l_het > 0.2)
for l_het, s_het in to_plot_subset[['LHON_het', 'SILENT_ONLY_het']].to_numpy()]
pct_above = round((numpy.sum(above_line)/len(above_line))*100, 2)
axes[ax_idx].plot(xvals, yvals, color='k', linewidth=2)
axes[ax_idx].set_xlim((-0.05, 1.05))
axes[ax_idx].set_ylim((-0.05, 1.05))
axes[ax_idx].set_title(f'{cond}, {pct_above} % above line')
fig.tight_layout()
fig, axes = pyplot.subplots(nrows=3, ncols=3, figsize=(12,12), sharey=True, sharex=True)
xorder = ['d0_lhon', 'd5_low_lhon', 'd5_med_lhon', 'd5_high_lhon', 'd5_unsort_lhon',
'd0_silent', 'd5_low_silent', 'd5_high_silent', 'd5_unsort_silent']
for idx, cond in enumerate(xorder):
ax_idx = (idx//3, idx%3)
to_plot_subset = valid_cells.loc[valid_cells['condition_no_rep'] == cond]
seaborn.kdeplot(data=to_plot_subset, x='LHON_het', y='SILENT_ONLY_het',
color=f'C{idx}', ax=axes[ax_idx])
xvals = [0,0.2,0.2]
yvals = [0.2, 0.2, 0]
above_line = [(s_het > 0.2) or (l_het > 0.2)
for l_het, s_het in to_plot_subset[['LHON_het', 'SILENT_ONLY_het']].to_numpy()]
pct_above = round((numpy.sum(above_line)/len(above_line))*100, 2)
axes[ax_idx].plot(xvals, yvals, color='k', linewidth=2)
axes[ax_idx].set_xlim((-0.05, 1.05))
axes[ax_idx].set_ylim((-0.05, 1.05))
axes[ax_idx].set_title(f'{cond}, {pct_above} % above line')
fig.tight_layout()